/* RAG增强信息样式 */
.rag-info-container {
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
  border: 2px solid #007bff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
  position: relative;
  animation: ragFadeIn 0.3s ease-in-out;
}

@keyframes ragFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rag-info-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #007bff, #0056b3);
  border-radius: 12px;
  z-index: -1;
  opacity: 0.1;
}

.rag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rag-title {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #0056b3;
}

.rag-title i {
  margin-right: 8px;
  color: #007bff;
  font-size: 16px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

.rag-badge {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.rag-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.rag-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rag-stats .el-tag {
  transition: all 0.3s ease;
}

.rag-stats .el-tag:hover {
  transform: scale(1.05);
}

.rag-confidence {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 123, 255, 0.2);
}

.confidence-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #0056b3;
  margin-bottom: 8px;
}

.rag-results {
  margin-top: 12px;
}

.rag-result-item {
  background-color: #ffffff;
  border: 1px solid #e8f2ff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.rag-result-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
  border-color: #007bff;
}

.rag-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f8ff;
}

.similarity-score {
  font-size: 12px;
  font-weight: 600;
  color: #0056b3;
}

.rag-result-content {
  font-size: 13px;
  line-height: 1.5;
}

.rag-question, .rag-answer {
  margin-bottom: 8px;
}

.rag-question strong, .rag-answer strong {
  color: #0056b3;
  font-weight: 600;
}

/* 用户消息的RAG信息样式调整 */
.own-message .rag-info-container {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  border-color: #28a745;
}

.own-message .rag-info-container::before {
  background: linear-gradient(45deg, #28a745, #155724);
}

.own-message .rag-title {
  color: #155724;
}

.own-message .rag-title i {
  color: #28a745;
}

.own-message .rag-badge {
  background: linear-gradient(135deg, #28a745, #155724);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .rag-info-container {
    padding: 12px;
    margin-bottom: 10px;
  }
  
  .rag-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .rag-stats {
    gap: 4px;
  }
  
  .rag-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
